﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AcheiCampinas.master" AutoEventWireup="true" CodeFile="AdminAnuncio.aspx.cs" Inherits="AdminAnuncio" %>

<%@ Register src="UserControls/UserInfo.ascx" tagname="UserInfo" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<p>
    <uc1:UserInfo ID="UserInfo1" runat="server" />
    <asp:Label ID="statusLabel" runat="server" Text=""></asp:Label>
    <asp:Label ID="infoLabel" runat="server" Text=""></asp:Label>
</p>
<asp:GridView ID="grid" runat="server" DataKeyNames="produtoID" 
        AutoGenerateColumns="False" Width="558px" onrowcancelingedit="grid_RowCancelingEdit" onrowediting="grid_RowEditing" 
    onrowupdating="grid_RowUpdating">
    <Columns>
        <asp:TemplateField HeaderText="Produto">
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" 
                    ImageUrl='<%# Eval("imagem1", "ImagensProdutos/{0}") %>' Width="80px" Height="80px" ReadOnly="True" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Nome" SortExpression="nome">
            <EditItemTemplate>
                <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("nome") %>' Width="97%"></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("nome") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Descrição" SortExpression="descricao">
            <EditItemTemplate>
                <asp:TextBox ID="descriptionTextBox" runat="server" Text='<%# Bind("descricao") %>' TextMode="MultiLine" Height="100px" Width="97%"></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label2" runat="server" Text='<%# Bind("descricao") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Preço" SortExpression="preco">
            <EditItemTemplate>
                <asp:TextBox ID="priceTextBox" runat="server" Text='<%# String.Format("{0:0.00}", Eval("price")) %>' Width="45px"></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label3" runat="server" Text='<%# String.Format("{0:0.00}", Eval("price")) %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
        <ItemTemplate>
          <asp:HyperLink Runat="server" Text="+info" NavigateUrl='<%# "AdminDetalhesProduto.aspx?ProdutoID="+ Eval("produtoID")+"&Categoria="+Eval("categoriaID")+"&EmpresaID="+Eval("empresaID")  %>' ID="HyperLink1" >
          </asp:HyperLink>
        </ItemTemplate>
      </asp:TemplateField>
      <asp:CommandField ShowEditButton="True" SelectText="+info" 
            UpdateText="Atualizar" EditText="Editar" CancelText="Cancelar" />
    </Columns>
</asp:GridView>

</asp:Content>

